<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <img src="./czc.png" alt="">
  <script>
    let img = document.querySelector('img');
    img.onclick = function(){
      console.dir(img);
      if(img.src.indexOf('czc.png') >= 0){
        img.src = 'cat.jpg';
      }else if(img.src.lastIndexOf('cat.jpg')>0){
        img.src = 'czc.png';
      }
    }
  </script>  
</body>
</html>
